package com.itbuka.goods.feign;

import com.itbuka.goods.domain.Detail;
import com.itbuka.entity.Result;
import com.itbuka.goods.domain.GoodsProductDetails;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "goods")
public interface GoodsFeign {
    @GetMapping("/detail/findDetail")
    Result<Detail> findDetail(@RequestParam Long id);

    @PostMapping("/GoodsProductDetails/selectList")
    Result<List<GoodsProductDetails>> select(@RequestBody GoodsProductDetails goodsProductDetails);


    @GetMapping(value = "/GoodsProductDetails/reduceStock" )
    Result<?> reduceStock(@RequestParam Long productId,@RequestParam Integer num);

}